package config

import (
	"fmt"
	"github.com/spf13/viper"
)

var Viper *viper.Viper

func init() {
	Viper = viper.New()

	Viper.SetConfigType("yaml")
	Viper.SetConfigName(".env")
	Viper.AddConfigPath(".")

	err := Viper.ReadInConfig() // Find and read the config file
	if err != nil { // Handle errors reading the config file
		panic(fmt.Errorf("Fatal error config file: %w \n", err))
	}
}